package org.xiangfei.client;

import java.util.logging.Level;
import java.util.logging.Logger;

import io.netty.channel.Channel;
import org.xiangfei.client.handler.MessageClientHandler;
import org.xiangfei.codec.bean.XFMessage;

/** 
* @author feesx@qq.com: 
* @version 2017年7月6日 上午10:50:54 
* 类说明 
*/
public class XFTopic {
    private Logger logger=Logger.getLogger(XFTopic.class.getName());

    private Channel channel;
    public XFTopic(Channel channel) {
        this.channel = channel;
    }
    public void publish(XFMessage message) {
        System.out.println("====");
        try {
            logger.log(Level.INFO, "sss");

            System.out.println("发送消息");
            channel.writeAndFlush(message).sync();
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    
} 
